package com.itmk.web.sys_user.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

import java.math.BigDecimal;
import java.util.Collection;
import java.util.Date;

@Data
@TableName("sys_user")
public class SysUser implements UserDetails {
    @TableId(type = IdType.AUTO)
    private Long userId;
    private String username;
    private String password;
    private String phone;
    private String email;
    private String sex;
    private String isAdmin;
    //部署用户表，需要排除
    @TableField(exist = false)
    private String roleId;
    //账户是否过期1:未过期，0：过期
    private boolean isAccountNonExpired = true ;
    //账户是否锁定1:未锁定，0：锁定
    private boolean isAccountNonLocked = true ;
    //密码是否过期1:过期，0：不过期
    private boolean isCredentialsNonExpired = true ;
    //账户是否可用1:可用，0：不可用
    private boolean isEnabled = true ;
    private String nickName;
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date createTime;
    @JsonFormat(pattern = "yyyy-MM-dd")
    private  Date updateTime;
    //用户权限字段集合
    @TableField(exist = false)
    Collection<? extends GrantedAuthority> authorities;
    private Integer deptId;
    private String education;
    private String jobTitle;
    private String image;
    private String introduction;
    private  String visitAddress;
    @TableField(exist = false)
    private String deptName;
    private String toHome;
    private String goodAt;
    private BigDecimal price;


}
